package main

import (
	"fmt"
	"io"
	"net/http"
)

// 使用 DefaultServeMux
func main() {
	http.HandleFunc("/home", home)
	http.HandleFunc("/login", login)

	if err := http.ListenAndServe(":8000", nil); err != nil {
		fmt.Println("http ListenAndServe failed")
	}
}

func home(w http.ResponseWriter, r *http.Request) {
	io.WriteString(w, "welcome master xiao ^.^")
}

func login(w http.ResponseWriter, r *http.Request) {
	io.WriteString(w, "Login success!!")
}
